<?php
namespace Login\model;

class User
{

    public $id;

    public $name;

    public $email;

    public $password;

    public function setPassword($clear_password)
    {
        $this->password = md5($clear_password);
    }

    function exchangeArray($data)
    {
        $this->name = (isset($data['NAME'])) ? $data['NAME'] : null;
        $this->email = (isset($data['EMAIL'])) ? $data['EMAIL'] : null;
        if (isset($data["PASSWORD"])) {
            $this->setPassword($data["PASSWORD"]);
        }
    }
    
}